import { createRouter, createWebHistory } from "vue-router";
import Home from "@/views/Home.vue";
// 这种写法导致在加载某个页面的时候，不显示的页面也被加载了
// import ImageGallery from '@/views/ImageGallery.vue'

// 路由表
const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/home",
    name: "home",
    component: Home,
  },
  {
    path: "/imageGallery",
    // component: ImageGallery,
    component: () => import("@/views/ImageGallery.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
